import 'package:dio/dio.dart';
import 'package:sainbainu/common/enums/message_type.dart';
import 'package:sainbainu/common/http/http.dart';

class MessageApi {
  /// 赞和收藏列表
  Future<Map<String, dynamic>> likeCollectionList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/get_operate_msg',
      params: params,
    );
    return res.data;
  }

  /// 评论列表
  Future<Map<String, dynamic>> commentList(
    Map<String, dynamic> params,
  ) async {
    Response res = await Http.get(
      '/api/customer/get_comment_list',
      params: params,
    );
    return res.data;
  }

  /// 获取未读消息数量
  Future<Map<String, dynamic>> getMessageNum() async {
    Response res = await Http.get('/api/customer/get_msg_num');
    return res.data;
  }

  /// 清除消息数量 并重新获取
  Future<Map<String, dynamic>> clearMessageNum(dynamic data) async {
    Response res = await Http.post(
      '/api/customer/clear_msg',
      data: data,
    );
    return res.data;
  }
}
